<#ftl encoding="UTF-8"> 
<#import "/spring.ftl" as spring />
<#include "../../consts.ftl">
<#global spring=JspTaglibs["/WEB-INF/tld/spring.tld"]>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>资源查询</title>
<script type="text/javascript" src="${jturl}/js/ajaxpage.js"></script>
<script type="text/javascript" src="${jturl}/js/ajaxcodec.js"></script>
<script type="text/javascript" src="${jturl}/js/My97DatePicker/WdatePicker.js"></script>
<script language="javascript">
function delbatch(){
	var frm = document.getElementById("frm");
	var chkVal = "";
	var checkValues = document.getElementsByName("checkValue");
	if(checkValues==null || !checkValues.length || checkValues.length<=0){
		return;
	}
	for(var i=0; i<checkValues.length; i++){
		if(!checkValues[i].checked){
			continue;
		}
		if(chkVal==""){
			chkVal = checkValues[i].value;
		}else{
			chkVal = chkVal + "," + checkValues[i].value;
		}
	}
	if(chkVal==""){
		alert("请选择要删除的数据！");
		return;
	}
	if(confirm("是否确定要删除选中的数据？")){
		var obj = new Object();
		obj.url = "${ctx}/admin/auth/res/delbatch.htm?checkValue=" + chkVal;
		obj.success = function(data, textStatus, XMLHttpRequest){
			try{
				eval("var resObj = "+data+";");
				if(resObj.result=="OK"){
					alert("删除成功！");
				}else if(resObj.msg!=null){
					alert(resObj.msg);
				}
			}catch(e){alert(e);};
			refreshListPage();
		};
		obj.error = function(XMLHttpRequest, textStatus, errorThrown){
			alert("删除失败，请稍后重试。");
		};
		ajaxRequest(obj);
	}
}
</script>
</head>
<body>
<!-- WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'}) -->
resName: <input type="text" id="resName" name="resName"> 
resCode: <input type="text" id="resCode" name="resCode">  
resType: <input type="text" id="resType" name="resType">  
resLink: <input type="text" id="resLink" name="resLink"> <br/>
<input type="button" name="BTN_QRY" value="查 询" onclick="query();"/>
<a href="${ctx}/admin/auth/res/add.htm">添加</a> 
	&nbsp; 
<a href="javascript:delbatch()">删除</a>
<div  id="paginationResult"></div>
	 </td>
  </tr>
</table>
<script>
function query(){
	var queryUrl = "${ctx}/admin/auth/res/inc_list.htm";
	var params = "divid=paginationResult";
	if($j("#resName").val()!=""){
		params = params+"&resName=" + $j("#resName").val();
	}
	if($j("#resCode").val()!=""){
		params = params+"&resCode="+ $j("#resCode").val();
	}
	if($j("#resType").val()!=""){
		params = params+"&resType="+ $j("#resType").val();
	}
	if($j("#resLink").val()!=""){
		params = params+"&resLink="+ $j("#resLink").val();
	} 
	ajaxFormRequest('{url:"' + queryUrl +'", params:"' + params + '", id:"paginationResult"}');
}
$j(function(){
	query();
});
</script>
</body>
</html>
